package com.dev.demo;

/**
 * @description:
 * @className: CLInitDemo
 * @package: com.dev.demo
 * @author: yangzhi@hsyuntai.com
 * @date: 2019-04-13 15:22
 * @copyright: 版权归 HSYUNTAI 所有
 */
public class CLInitDemo {

    public static class Hello {
        static {
            System.out.println("static语句块：hello");
        }
    };

    public static void main(String[] args) {
        ClassLoader cl = ClassLoader.getSystemClassLoader();
        String className = CLInitDemo.class.getName() + "$Hello";
        try {
            Class<?> cls1 = cl.loadClass(className);
            System.out.println("----我是分割线----");
            Class<?> cls2 = Class.forName(className);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

}
